<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>编辑总分类</title>
<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	#category_image {
        cursor: pointer;
	}
</style>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; 编辑总分类
	</div>
	<form id="inputForm" action="update.htm" method="post">
		<input type="hidden" name="id" value="${category.id}" />
		<table class="input">
			<tr>
				<th>
					<span class="requiredField">*</span>分类名称:
				</th>
				<td>
					<input type="text" name="name" class="text" value="${category.name}" maxlength="6" placeholder="请输入分类名称"/>
				</td>
			</tr>
            <tr>
                <th>
                    分类图片:
                </th>
                <td>
                <span class="fieldSet">
                    <input type="text" name="imageURL" class="text" value="${category.imageURL}" maxlength="200" title="${message("admin.imageTitle")}" placeholder="请选择图片上传"/>
                    <input type="button" id="browserButton" class="button" value="${message("admin.browser.select")}" /> 大小40px*40px以内 底色透明
				[#if category.imageURL??]
                    <img src="${category.imageURL}" class="browserImage" id="category_image"/>
				[/#if]
                </span>
                </td>
            </tr>
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="${message("admin.common.submit")}" />
					<input type="button" class="button" value="${message("admin.common.back")}" onclick="location.href='list.htm'" />
				</td>
			</tr>
		</table>
	</form>
</body>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/admin/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<script type="text/javascript">

    $().ready(function() {

        var $inputForm = $("#inputForm");
        var $browserButton = $("#browserButton");

        $("#category_image").on("click", function () {
			window.open($(this).attr("src"));
        })

	[@flash_message /]

        $browserButton.browser();

        // 表单验证
        $inputForm.validate({
            rules: {
                name: "required"
            }
        });

    });
</script>
</html>
